package cn.wolfcode._IOday01_.text002;

public class Resource implements Runnable{
    private int page = 50 ;

    public Resource() {
    }

    @Override
    public void run() {
        synchronized(this){
          while(page>0) {
            page--;
            Thread h = Thread.currentThread();
            System.out.println(h + "消费了第" + page + "个水饺");
          }
        }
    }
}
